package com.colorsstudio.defence.test 
{
	import adobe.utils.CustomActions;
	import de.polygonal.ds.Array2;
	import de.polygonal.ds.Array3;
	import de.polygonal.ds.ArrayedDeque;
	import de.polygonal.ds.ArrayedQueue;
	import de.polygonal.ds.ArrayedStack;
	import de.polygonal.ds.BitVector;
	import de.polygonal.ds.BST;
	import de.polygonal.ds.Comparable;
	import de.polygonal.ds.NodeValIterator;
	import de.polygonal.ds.Queue;
	import de.polygonal.ds.TreeBuilder;
	import de.polygonal.ds.TreeIterator;
	import de.polygonal.ds.TreeNode;
	
	import flash.display.Sprite;
	/**
	 * ...
	 * @author wuzhida
	 */
	public class DataStructure 
	{
		
		public function DataStructure() 
		{
			trace("Hello , you are in the datastructure test class");
			
			/*BitVector test:
			 * 
			 * var bitVector:BitVector = new BitVector(20);
			bitVector.set(2);
			bitVector.set(0);
			trace(bitVector.has(2));
			trace(bitVector);*/
			
			/*Array2 test:
			* 
			*var array2:Array2 = new Array2(10, 10);
			array2.set(1, 1, new Sprite());
			trace(array2.get(1, 1));*/
			
			/*ArrayQueue test:
			 * 
			 * var arrayQueue:ArrayedQueue = new ArrayedQueue(20, 1, 20);
			arrayQueue.enqueue("first");
			trace(arrayQueue.peek());*/
			
			/*Array3D test:
			 * 
			 * var array3d:Array3 = new Array3(10, 10, 10);
			array3d.set(1, 1, 1, "wuzhida");
			trace(array3d.get(1, 1, 1));*/
			
			/*arrayStack test:
			 * 
			 * var arrayStack:ArrayedStack = new ArrayedStack(5, 10);
			arrayStack.push(10);
			trace(arrayStack.pop());*/
			
			/*var a:MyNode = new MyNode(1);
			var b:MyNode = new MyNode(2);
			var c:MyNode = new MyNode(3);
			a.next = b;
			b.next = c;
			c.next = null;
			
			
			var queue:ArrayedQueue = new ArrayedQueue(4, true, 4);
			queue.enqueue(20);
			queue.enqueue(20);
			queue.enqueue(20);
			queue.enqueue(20);
			//queue.enqueue(20);*/
			
			var treeNode:TreeNode = new TreeNode("root");
			var builder:TreeBuilder = new TreeBuilder(treeNode);
			
			/*for (var i:int = 0; i < 3; i++)
			{
				treeNode.appendNode(new TreeNode(20));
			}*/
			
			builder.appendChild(110);
			builder.appendChild(210);
			builder.prevChild();
			builder.down();
			builder.appendChild(2100);
			
			treeNode.preorder(trace);		
			treeNode.postorder(trace, false, 20);			
			treeNode.levelorder(trace);			
			//trace(treeNode);
		}
	}
}
	
	
